package ink.onei.parse.service.serviceImpl;

import java.util.List;
import ink.onei.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import ink.onei.parse.mapper.TdRawWaterTypeMapper;
import ink.onei.parse.domain.TdRawWaterType;
import ink.onei.parse.service.ITdRawWaterTypeService;


/**
 * @Author: dang
 * @Description: TODO
 * @Date: 2024/3/16 9:10 星期六
 */
@Service
public class TdRawWaterTypeServiceImpl implements ITdRawWaterTypeService {

    @Autowired
    private TdRawWaterTypeMapper tdRawWaterTypeMapper;

    /**
     * 查询原料水检测分类
     *
     * @param id 原料水检测分类主键
     * @return 原料水检测分类
     */
    @Override
    public TdRawWaterType selectTdRawWaterTypeById(Long id) {
        return tdRawWaterTypeMapper.selectTdRawWaterTypeById(id);
    }

    /**
     * 查询原料水检测分类列表
     *
     * @param tdRawWaterType 原料水检测分类
     * @return 原料水检测分类
     */
    @Override
    public List<TdRawWaterType> selectTdRawWaterTypeList(TdRawWaterType tdRawWaterType) {
        return tdRawWaterTypeMapper.selectTdRawWaterTypeList(tdRawWaterType);
    }

    /**
     * 新增原料水检测分类
     *
     * @param tdRawWaterType 原料水检测分类
     * @return 结果
     */
    @Override
    public int insertTdRawWaterType(TdRawWaterType tdRawWaterType) {
        tdRawWaterType.setCreateTime(DateUtils.getNowDate());
        return tdRawWaterTypeMapper.insertTdRawWaterType(tdRawWaterType);
    }

    /**
     * 修改原料水检测分类
     *
     * @param tdRawWaterType 原料水检测分类
     * @return 结果
     */
    @Override
    public int updateTdRawWaterType(TdRawWaterType tdRawWaterType) {
        tdRawWaterType.setUpdateTime(DateUtils.getNowDate());
        return tdRawWaterTypeMapper.updateTdRawWaterType(tdRawWaterType);
    }

    /**
     * 批量删除原料水检测分类
     *
     * @param ids 需要删除的原料水检测分类主键
     * @return 结果
     */
    @Override
    public int deleteTdRawWaterTypeByIds(Long[] ids) {
        return tdRawWaterTypeMapper.deleteTdRawWaterTypeByIds(ids);
    }

    /**
     * 删除原料水检测分类信息
     *
     * @param id 原料水检测分类主键
     * @return 结果
     */
    @Override
    public int deleteTdRawWaterTypeById(Long id) {
        return tdRawWaterTypeMapper.deleteTdRawWaterTypeById(id);
    }
}
